<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <title>CompressedRowMatrix - Real</title>
</head>
<body>

<h1>

<hr WIDTH="100%"></h1>

<center>
<h1>
CompressedRowMatrix - Real</h1></center>

<h2>

<hr WIDTH="100%"></h2>
The CompressedRowMatrix is a sparse row-major matrix of double values.
The matrix elements are stored in four internal arrays, one holds the element's
value, one holds the element's column index and the other two identify
the elements for a row. Using two arrays to identify the elements in a
row instead of one allows the matrix to hold extra elements for a row to
accomodate fill-in. This matrix is efficient for numerical computing, especially
row-wise computations.
<p>Here is an example of a sparse matrix with four rows and four columns:
<br>&nbsp;
<table BORDER >
<tr ALIGN=CENTER VALIGN=CENTER>
<td></td>

<td>Col-0</td>

<td>Col-1</td>

<td>Col-2</td>

<td ALIGN=CENTER VALIGN=CENTER>Col-3</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>Row-0</td>

<td>1.3</td>

<td>.</td>

<td>4.5</td>

<td>.</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>Row-1</td>

<td>.</td>

<td>2.1</td>

<td>.</td>

<td>.</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>Row-2</td>

<td>.</td>

<td>.</td>

<td>.</td>

<td ALIGN=CENTER VALIGN=CENTER>6.2</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>Row-3</td>

<td>7.3</td>

<td>8.5</td>

<td>.</td>

<td>.</td>
</tr>
</table>

<p>This is how the 4x4 matrix could be stored in a CompressedRowMatrix
with a row capacity of five:
<br>&nbsp;
<table BORDER >
<caption>Row-Begin</caption>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Index&nbsp;</td>

<td>&nbsp;0&nbsp;</td>

<td>&nbsp;1&nbsp;</td>

<td>&nbsp;2&nbsp;</td>

<td>&nbsp;3&nbsp;</td>

<td>&nbsp;4&nbsp;</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Value&nbsp;</td>

<td>0</td>

<td>2</td>

<td>4</td>

<td>6</td>

<td>.</td>
</tr>
</table>

<table BORDER >
<caption>Row-Size</caption>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Index&nbsp;</td>

<td>&nbsp;0&nbsp;</td>

<td>&nbsp;1&nbsp;</td>

<td>&nbsp;2&nbsp;</td>

<td>&nbsp;3&nbsp;</td>

<td>&nbsp;4&nbsp;</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Value&nbsp;</td>

<td>2</td>

<td>1</td>

<td>1</td>

<td>2</td>

<td>.</td>
</tr>
</table>

<table BORDER >
<caption>Values</caption>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Index&nbsp;</td>

<td>&nbsp; 0&nbsp;</td>

<td>&nbsp; 1&nbsp;</td>

<td>&nbsp; 2&nbsp;</td>

<td>&nbsp; 3&nbsp;</td>

<td>&nbsp; 4&nbsp;</td>

<td>&nbsp; 5&nbsp;</td>

<td>&nbsp; 6&nbsp;</td>

<td>&nbsp; 7&nbsp;</td>

<td>&nbsp; 8&nbsp;</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Value&nbsp;</td>

<td>1.3</td>

<td>4.5</td>

<td>2.1</td>

<td>.</td>

<td>6.2</td>

<td>.</td>

<td>7.3</td>

<td>8.5</td>

<td>.</td>
</tr>
</table>

<table BORDER >
<caption>Column-Index</caption>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Index&nbsp;</td>

<td>&nbsp;0&nbsp;</td>

<td>&nbsp;1&nbsp;</td>

<td>&nbsp;2&nbsp;</td>

<td>&nbsp;3&nbsp;</td>

<td>&nbsp;4&nbsp;</td>

<td>&nbsp;5&nbsp;</td>

<td>&nbsp;6&nbsp;</td>

<td>&nbsp;7&nbsp;</td>

<td>&nbsp;8&nbsp;</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Value&nbsp;</td>

<td>0</td>

<td>2</td>

<td>1</td>

<td>.</td>

<td>3</td>

<td>.</td>

<td>0</td>

<td>1</td>

<td>.</td>
</tr>
</table>

<h2>
Column Index Structure</h2>
The CompressedRowMatrix can contain an index into the columns of the matrix.This
index must be explicitly built after the last element has been added to
the matrix. The index will be deleted if any elements are added after it
is built
<p>This is how the index would be stored for the 4x4 example:
<br>&nbsp;
<br>&nbsp;
<table BORDER >
<caption>Column-End</caption>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Index&nbsp;</td>

<td>&nbsp;0&nbsp;</td>

<td>&nbsp;1&nbsp;</td>

<td>&nbsp;2&nbsp;</td>

<td>&nbsp;3</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Value&nbsp;</td>

<td>2</td>

<td>4</td>

<td>5</td>

<td>6</td>
</tr>
</table>

<table BORDER >
<caption>Row-Index</caption>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Index&nbsp;</td>

<td>&nbsp; 0&nbsp;</td>

<td>&nbsp; 1&nbsp;</td>

<td>&nbsp; 2&nbsp;</td>

<td>&nbsp; 3&nbsp;</td>

<td>&nbsp; 4&nbsp;</td>

<td>&nbsp; 5&nbsp;</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Value&nbsp;</td>

<td>0</td>

<td>3</td>

<td>1</td>

<td>3</td>

<td>0</td>

<td>2</td>
</tr>
</table>

<table BORDER >
<caption>Value-Index</caption>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Index&nbsp;</td>

<td>&nbsp; 0&nbsp;</td>

<td>&nbsp; 1&nbsp;</td>

<td>&nbsp; 2&nbsp;</td>

<td>&nbsp; 3&nbsp;</td>

<td>&nbsp; 4&nbsp;</td>

<td>&nbsp; 5&nbsp;</td>
</tr>

<tr ALIGN=CENTER VALIGN=CENTER>
<td>&nbsp;Value&nbsp;</td>

<td>0</td>

<td>6</td>

<td>2</td>

<td>7</td>

<td>1</td>

<td>4</td>
</tr>
</table>

<p>
<hr WIDTH="100%">
<br>Copyright(C)1997-99 by DRA Systems all rights reserved.
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;
</body>
</html>
